package com.yonyou.cyxdms.basedata.service.repository.color;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorCacheCMSVO;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorCacheVO;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorVO;
import com.yonyou.cyxdms.basedata.service.dto.CarInfoDTO;
import com.yonyou.cyxdms.basedata.service.dto.dmsFeign.SaveOrUpdateBasicAllDTO;
import com.yonyou.cyxdms.basedata.service.dto.dmsFeign.SaveOrUpdateColorOrTrimDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.CarColorDTO;
import com.yonyou.cyxdms.basedata.service.entity.color.ColorPO;
import com.yonyou.cyxdms.basedata.service.vo.CarInfoVO;
import com.yonyou.cyxdms.basedata.service.vo.color.ColorsVO;
import com.yonyou.cyxdms.basedata.service.vo.color.ExteriorAndInteriorColorVO;
import com.yonyou.cyxdms.basedata.service.vo.color.PageColorVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 车辆颜色 Mapper 接口
 * </p>
 *
 * @author guorp
 * @since 2018-12-14
 */
public interface ColorMapper extends SuperMapper<ColorPO> {

    /**
     * 根据packageId查询颜色
     *
     * @param packageId
     * @param appId
     * @param groupCode
     * @param ownerCode
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CarColorDTO>
     * @author guorp
     * @since 2018/12/14
     */
     List<ColorVO> getColorByPackageId(@Param("packageId") Long packageId, @Param("appId") String appId,
                                             @Param("groupCode") String groupCode, @Param("ownerCode") String ownerCode);

     /**
      * 根据optionId查询颜色
      *
      * @param optionId
      * @param appId
      * @param groupCode
      * @param ownerCode
      * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CarColorDTO>
      * @author zys
      * @since 2020/2/10
      */
      List<ColorVO> getColorByPackageIdV2(@Param("optionId") Long optionId, @Param("appId") String appId,
                                              @Param("groupCode") String groupCode, @Param("ownerCode") String ownerCode);

     
     
    /**
     * 按条件查询颜色信息
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.ColorCacheVO>
     * @author renwd
     * @since 2018/12/18
     */
    List<ColorCacheVO> queryColorByCondition(@Param("params") Map<String, Object> queryParam);

    /**
     * 查询所有颜色
     *
     * @param
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.dto.basedata.CarColorDTO>
     * @author renwd
     * @since 2019/2/28
     */
    List<ColorVO> listColor(@Param("isValid") Integer isValid, @Param("ownerCode") String ownerCode);

    /**
     * 根据车系id或车型id或配置id或颜色id查询车型信息
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.CarInfoVO>
     * @author renwd
     * @since 2019/6/25
     */
    CarInfoVO carInfoByCondition(@Param("params") CarInfoDTO queryParam);

    public Map<String, Object> queryMinAndMaxPriceMapByCarId(@Param("carId") Long carId);

    /**
     * 分页查询车辆颜色
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.color.PageColorVO>
     * @author renwd
     * @since 2019/7/17
     */
    List<PageColorVO> pageColor(IPage page, @Param("params") Map<String, Object> queryParam);

    /**
     * 分页查询Dcs车辆颜色
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.color.PageColorVO>
     * @author renwd
     * @since 2019/7/17
     */
    List<PageColorVO> pageDcsColor(IPage page, @Param("params") Map<String, Object> queryParam);

    /**
     * 检查颜色是否重复
     *
     * @param carColorDTO
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author renwd
     * @since 2019/7/17
     */
    List<Map<String, Object>> checkForDuplication(CarColorDTO carColorDTO);

    /**
     * 检查颜色是否重复(新增)
     *
     * @param carColorDTO
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author renwd
     * @since 2019/7/17
     */
    List<Map<String, Object>> checkForDuplicationForInsert(CarColorDTO carColorDTO);

    /**
     * 查询外饰内饰
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.color.ExteriorAndInteriorColorVO>
     * @author renwd
     * @since 2019/7/18
     */
    List<ExteriorAndInteriorColorVO> selectExteriorColorInfo(@Param("params") Map<String, Object> queryParam);

    /**
     * 根据code查询颜色
     *
     * @param appId
     * @param colorCode
     * @return com.yonyou.cyxdms.basedata.service.entity.color.ColorPO
     * @author lijun
     * @since 2019/9/12
     */
    ColorPO getByCode(@Param("appId") String appId, @Param("colorCode") String colorCode);

    List<ColorCacheCMSVO> queryColorByConditionCms(@Param("params")  Map<String, Object> queryParam);

    /**
     * 查询颜色模板
     *
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.color.ColorsVO>
     * @author caozx
     * @since 2020/12/10
     */
    List<ColorsVO> queryColorExport();

    /**
     * 颜色代码+名称 在系统中是否存在
     *
     * @param
     * @return
     * @author caozx
     * @since 2020/12/10
     */
    Map<String,Object> ifExist(@Param("colorCode") String colorCode,@Param("colorName") String colorName,@Param("colorType") String colorType);

    //查询接口下发数据
    List<SaveOrUpdateColorOrTrimDTO> sendVehicleColorInfo(@Param("params") Map<String, String> queryParam);

}
